home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / crystal / cvobj.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-01-12  |  1.2 KB  |  39 lines

  1. /* cvobj.h
  2.  *    include file for objects list
  3.  *********************************************************************/
  4.  
  5. struct conn {
  6.     struct cvobj *who;
  7.     struct cvloc *where;
  8.     struct conn *link;
  9.     };
  10.  
  11. struct cvobj {
  12.     char *desc;        /* object description */
  13.     char *props;        /* all property messages, in order */
  14.     int iloc,        /* initial location */
  15.         iloc2,        /* initial second location */
  16.         iprop;        /* initial property */
  17.     int prop;        /* current property number */
  18.     struct conn conn1,    /* link to next obj here */
  19.         conn2;        /* link to next obj at 2nd loc */
  20.     };
  21.  
  22. extern struct cvobj cvobj[] ;
  23.  
  24. #define    TAKEN    (&(cvloc[0]))    /* use that place for something */
  25. #define    LOST    ((struct cvloc *) 0)
  26. #define FIXED    TAKEN
  27.  
  28. #define OBJSIZ    100
  29. #define ISOBJ(object)    ((object) < OBJSIZ)
  30. #define    INBARN(object)    ((object)->conn1.where == &(cvloc[2]))
  31. #define    AT(object)        ( ((object)->conn1.where == loc ) \
  32.                             || ((object)->conn2.where == loc) )
  33. #define    HERE(object)    ( ((object)->conn1.where == loc ) \
  34.                             || (TOTING(object)) )
  35. #define TOTING(object)    ( (object)->conn1.where == TAKEN )
  36. #define    FOUND(object)    ( (object)->prop >= 0 )
  37. #define    LIQ(object)        ((object->prop) ? (_WATER - 1 + (object->prop)) : 0)
  38. #define    ONUM(object)    ( (object) - cvobj )
  39.